package com.example.service;

import com.example.util.Config;
import org.apache.spark.sql.Dataset;
import org.apache.spark.sql.Row;
import org.apache.spark.sql.SparkSession;

/**
 * Author wangJinLong
 * Date 2025/7/31 16:13
 **/
public class SparkHdfs {

    public static void main(String[] args) {
        test();
    }

    public static void test() {
        SparkSession spark = SparkSession.builder().master("local[*]").getOrCreate();
        Dataset<Row> dataset = spark.read().csv("hdfs://" + Config.hdfs_host + ":9900/tmp/student.csv");
        dataset.show();
        spark.stop();
    }

    public static void test2() {

    }


}
